<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>电子印章生成器</title>
  <style>
    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      display: flex;
      flex-direction: column;
      font-family: Arial, sans-serif;
      color: #333;
      background-color: #f8f9fa;
      height: 100vh;
      overflow: hidden;
    }

    .preview-container {
      padding: 20px;
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: #fff;
      border-bottom: 1px solid #ddd;
      flex: 0 0 auto;
    }

    .seal-preview {
      margin: 0 auto;
      background-color: #f9f9f9;
      border: 1px dashed #ddd;
      display: inline-block;
    }

    canvas {
      display: block;
      background-color: white;
      max-width: 100%;
      max-height: 30vh;
    }

    .controls-container {
      flex: 1;
      padding: 15px;
      overflow-y: auto;
    }

    h1 {
      text-align: center;
      margin-bottom: 20px;
      color: #d9534f;
      font-size: 20px;
    }

    .controls {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }

    .form-group {
      display: flex;
      flex-direction: column;
    }

    label {
      display: block;
      margin-bottom: 5px;
      font-weight: bold;
      font-size: 14px;
    }

    input, select {
      width: 100%;
      padding: 8px 10px;
      border: 1px solid #ddd;
      border-radius: 4px;
      font-size: 14px;
    }

    input:focus, select:focus {
      outline: none;
      border-color: #d9534f;
    }

    .action-buttons {
      grid-column: span 2;
      display: flex;
      gap: 10px;
      margin-top: 15px;
    }

    button {
      padding: 10px 15px;
      border: none;
      border-radius: 4px;
      background-color: #d9534f;
      color: white;
      cursor: pointer;
      font-size: 14px;
      transition: background-color 0.3s;
      flex: 1;
    }

    button:hover {
      background-color: #c9302c;
    }

    button:disabled {
      background-color: #f0ad4e;
      cursor: not-allowed;
    }
  </style>
</head>
<body>
  <div class="preview-container">
    <div class="seal-preview">
      <canvas id="sealCanvas" width="168" height="168"></canvas>
    </div>
  </div>
  
  <div class="controls-container">
    <h1>电子印章生成器</h1>
    
    <div class="controls">
      <div class="form-group">
        <label for="companyName">公司名称(环形)</label>
        <input type="text" id="companyName" placeholder="请输入公司名称">
      </div>
      
      <div class="form-group">
        <label for="sealName">印章名称</label>
        <input type="text" id="sealName" placeholder="请输入印章名称">
      </div>
      
      <div class="form-group">
        <label for="sealCode">下载文件名</label>
        <input type="text" id="sealCode" placeholder="请输入">
      </div>
      
      <div class="form-group">
        <label for="sealSize">印章尺寸</label>
        <input type="number" id="sealSize" min="100" max="350" value="168" step="1">
      </div>
      
      <div class="form-group">
        <label for="lineWidth">线宽</label>
        <select id="lineWidth">
          <option value="1">1px</option>
          <option value="2">2px</option>
          <option value="3">3px</option>
          <option value="4" selected>4px</option>
          <option value="5">5px</option>
        </select>
      </div>
      
      <div class="form-group">
        <label for="centerScale">中心五角星大小(%)</label>
        <input type="number" id="centerScale" min="1" max="50" value="25" step="1">
      </div>
      
      <div class="form-group">
        <label for="mainSize">单位文字大小</label>
        <input type="number" id="mainSize" min="10" max="36" value="21" step="1">
      </div>
      
      <div class="form-group">
        <label for="mainRingSpace">单位文字与圆环距离</label>
        <input type="number" id="mainRingSpace" min="1" max="20" value="5" step="1">
      </div>
      
      <div class="form-group">
        <label for="sealNameSize">印章名称大小</label>
        <input type="number" id="sealNameSize" min="10" max="36" value="18" step="1">
      </div>
      
      <div class="form-group">
        <label for="sealNameUpSpace">印章名称距中心下移距离</label>
        <input type="number" id="sealNameUpSpace" min="10" max="100" value="50" step="1">
      </div>
      
      <div class="action-buttons">
        <button id="generateBtn">生成印章</button>
        <button id="downloadBtn" disabled>下载印章</button>
      </div>
    </div>
  </div>
  
  <script src="js/side_panel.js"></script>
</body>
</html> 